<?php

/**
 * OperadoresEgresos form base class.
 *
 * @method OperadoresEgresos getObject() Returns the current form's model object
 *
 * @package    cronos-doctrine
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseOperadoresEgresosForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                      => new sfWidgetFormInputHidden(),
      'tipo_concepto_cf_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('TipoConceptoCf'), 'add_empty' => false)),
      'concepto_cf_id'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ConceptoCf'), 'add_empty' => false)),
      'empresa_id'              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Empresa'), 'add_empty' => false)),
      'camioneta_id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Camioneta'), 'add_empty' => true)),
      'operador_id'             => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Operador'), 'add_empty' => false)),
      'is_franquicia'           => new sfWidgetFormInputCheckbox(),
      'operadores_prestamos_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('OperadoresPrestamos'), 'add_empty' => true)),
      'cantidad'                => new sfWidgetFormInputText(),
      'descripcion'             => new sfWidgetFormTextarea(),
      'monto'                   => new sfWidgetFormInputText(),
      'monto_deposito'          => new sfWidgetFormInputText(),
      'monto_pago'              => new sfWidgetFormInputText(),
      'efectivo'                => new sfWidgetFormInputText(),
      'noingreso'               => new sfWidgetFormInputText(),
      'adeudo'                  => new sfWidgetFormInputText(),
      'saldo_favor'             => new sfWidgetFormInputText(),
      'saldo_favor_menos'       => new sfWidgetFormInputText(),
      'fecha'                   => new sfWidgetFormDate(),
      'cancelacion_razon_id'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('CancelacionRazon'), 'add_empty' => true)),
      'nota'                    => new sfWidgetFormTextarea(),
      'nota_operador'           => new sfWidgetFormTextarea(),
      'nota_gerente'            => new sfWidgetFormTextarea(),
      'is_vista'                => new sfWidgetFormInputCheckbox(),
      'created_at'              => new sfWidgetFormDateTime(),
      'updated_at'              => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                      => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'tipo_concepto_cf_id'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('TipoConceptoCf'), 'required' => false)),
      'concepto_cf_id'          => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('ConceptoCf'), 'required' => false)),
      'empresa_id'              => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Empresa'), 'required' => false)),
      'camioneta_id'            => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Camioneta'), 'required' => false)),
      'operador_id'             => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Operador'))),
      'is_franquicia'           => new sfValidatorBoolean(array('required' => false)),
      'operadores_prestamos_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('OperadoresPrestamos'), 'required' => false)),
      'cantidad'                => new sfValidatorInteger(array('required' => false)),
      'descripcion'             => new sfValidatorString(array('required' => false)),
      'monto'                   => new sfValidatorNumber(array('required' => false)),
      'monto_deposito'          => new sfValidatorNumber(array('required' => false)),
      'monto_pago'              => new sfValidatorNumber(array('required' => false)),
      'efectivo'                => new sfValidatorNumber(array('required' => false)),
      'noingreso'               => new sfValidatorNumber(array('required' => false)),
      'adeudo'                  => new sfValidatorNumber(array('required' => false)),
      'saldo_favor'             => new sfValidatorNumber(array('required' => false)),
      'saldo_favor_menos'       => new sfValidatorNumber(array('required' => false)),
      'fecha'                   => new sfValidatorDate(),
      'cancelacion_razon_id'    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('CancelacionRazon'), 'required' => false)),
      'nota'                    => new sfValidatorString(array('required' => false)),
      'nota_operador'           => new sfValidatorString(array('required' => false)),
      'nota_gerente'            => new sfValidatorString(array('required' => false)),
      'is_vista'                => new sfValidatorBoolean(array('required' => false)),
      'created_at'              => new sfValidatorDateTime(),
      'updated_at'              => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('operadores_egresos[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'OperadoresEgresos';
  }

}
